package com.example.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.dto.*;
import com.example.entity.Article;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.vo.ArticleDetailVO;
import com.example.vo.ArticleDetailVO4Web;
import com.example.vo.ArticlePageVO;
import com.example.vo.CategoryDistributionVO;

import java.util.List;

/**
 * <p>
 * 文章表 服务类
 * </p>
 *
 * @author wuyunbin
 * @since 2024-10-19
 */
public interface ArticleService extends IService<Article> {

    void publish(ArticlePublishDTO articlePublishDTO);

    IPage<ArticlePageVO> getPage(ArticlePageDTO articlePageDTO);

    void removeArticle(ArticleDeleteDTO articleDeleteDTO);

    ArticleDetailVO detail(ArticleDetailDTO articleDetailDTO);

    void updateArticle(ArticlePublishDTO articlePublishDTO);

    ArticleDetailVO4Web getArticleDetail(ArticleDetailDTO articleDetailDTO);

    IPage<ArticlePageVO> getCategoryArticles(ArticlePageDTO articlePageDTO);

    IPage<ArticlePageVO> getTagArticles(ArticlePageDTO articlePageDTO);

//    ArticleDetailVO4Web getArticlePreview(ArticleDetailDTO articleDetailDTO);

    IPage<ArticlePageVO> getPageByUserId(ArticlePageDTO articlePageDTO);

    Integer getArticleCount();

    /**
     * 获取当前用户文章的分类分布
     * @return 分类分布数据列表
     */
    List<CategoryDistributionVO> getCategoryDistribution();
}
